﻿<!--
    全局
     <Application.Resources>
             <ResourceDictionary>
                 <ResourceDictionary.MergedDictionaries>
                     <ResourceDictionary Source="Styles/Style1.xaml"/>
                 </ResourceDictionary.MergedDictionaries>
             </ResourceDictionary>
     </Application.Resources>
 -->
<!--
    单页
      <ResourceDictionary>  
            <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="Styles/Style1.xaml"/>
            </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
 -->
<!--
    动态加载
    ResourceDictionary resourceDictionary = new ResourceDictionary();
    Application.LoadComponent(resourceDictionary, new Uri("/WindowsPhoneApplication1;component/Styles/Style2.xaml", UriKind.Relative));
    Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
    this.btn1.SetValue(Button.StyleProperty, Application.Current.Resources["ButtonStyle2"]);
 -->
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="ButtonStyle1"  TargetType="Button">
        <Setter Property="Content" Value="外联样式2"/>
        <Setter Property="Height" Value="100" />
        <Setter Property="Width" Value="200" />
        <Setter Property="Margin" Value="50,290,0,0"/>
        <Setter Property="Foreground" Value="Red" />
        <Setter Property="Background" Value="Blue" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
    </Style>
    <Style x:Key="ButtonStyle2"  TargetType="Button">
        <Setter Property="Content" Value="外联样式2"/>
        <Setter Property="Height" Value="100" />
        <Setter Property="Width" Value="200" />
        <Setter Property="Margin" Value="50,290,0,0"/>
        <Setter Property="Foreground" Value="Red" />
        <Setter Property="Background" Value="Blue" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
    </Style>
</ResourceDictionary>